<?php
	echo $this->HTML->css('loginV2');
	/** echo $this->HTML->css('cake.generic'); */
?>

<div class="users form">
<?php
$loggedUser = $this->Session->read('Auth.User');
 echo $this->Form->create('User'); ?>
	<fieldset>
		<legend><?php echo __('Edit User'); ?></legend>
	<?php
		echo $this->Form->hidden('id');
		echo $this->Form->input('title');
		echo $this->Form->input('first_name');
		echo $this->Form->input('middle_name');
		echo $this->Form->input('surname');
		echo $this->Form->input('email');
		echo $this->Form->input('password');
		echo $this->Form->input('address');
		echo $this->Form->input('suburb');
		echo $this->Form->input('state');
		echo $this->Form->input('postcode');
		echo $this->Form->input('country', array('options'=>$countries, 'label'=>'Country'));
		echo $this->Form->input('landline_number');
		echo $this->Form->input('mobile_number');
		if($loggedUser['role'] == 1)
		{
		echo $this->Form->input('role', array('options'=>$roles, 'label'=>'Role'));
		}
	?>
	</fieldset>
<?php echo $this->Form->end(__('Submit')); ?>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
	<?php if ($loggedUser['role'] == 9 )
	{?>
	
		<li><?php echo $this->Html->link(__('View Details'), array('controller' => 'users', 'action' => 'view', $loggedUser['id'])); ?> </li>
	
<?php }
	else {
	?>
		<li><?php echo $this->Html->link(__('List Users'), array('action' => 'index')); ?></li>
		<?php /*<li><?php echo $this->Html->link(__('List Documents'), array('controller' => 'documents', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Document'), array('controller' => 'documents', 'action' => 'add')); ?> </li>
	*/ ?>
	<?php
	}
	?>
	</ul>

</div>
